package com.jk.mindskip.controller;

import com.jk.mindskip.dto.TbAdmin;
import com.jk.mindskip.interfaces.TbAdminServiceApi;
import com.jk.mindskip.pojo.PagedResponse;
import com.jk.mindskip.service.TbAdminService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class TbAdminController implements TbAdminServiceApi {

    @Autowired
    private TbAdminService adminService;

    @Override
    public PagedResponse<TbAdmin> findAdminList(TbAdmin admin, Integer pageNum, Integer pageSize) {
        return adminService.findAdminList(admin, pageNum, pageSize);
    }

    @Override
    public void addAdmin(TbAdmin admin) {
        adminService.addAdmin(admin);
    }

    @Override
    public TbAdmin findTbAdminByUserName(String username) {
        return adminService.findTbAdminByUserName(username);
    }

    @Override
    public List<String> selectPermsByUserId(Integer id) {
        return adminService.selectPermsByUserId(id);
    }
}
